import service from '@/utils/request';

// 获取空间列表
export function getSpaceList(data) {
  return service({
    url: `/api/system/space/findSpacePage`,
    method: 'post',
    data,
  });
}

// 获取地址及坐标
export function getAddress(params) {
  return service({
    url: `/api/map/suggestion`,
    method: 'get',
    params,
  });
}

// 获取设施下拉
export function getFacilities(data) {
  return service({
    url: `/api/system/space/facilityList`,
    method: 'post',
    data,
  });
}

// 获取视频下拉
export function getVideoList(data) {
  return service({
    url: `/api/system/space/mediaList`,
    method: 'post',
    data,
  });
}

// 添加空间
export function addSpace(data) {
  return service({
    url: `/api/system/space/modifySpace`,
    method: 'post',
    data,
  });
}

// 删除空间
export function delSpace(id) {
  return service({
    url: `/api/system/space/deleteSpace?spaceId=${id}`,
    method: 'get',
  });
}

// 修改空间
export function modifySpace(data) {
  return service({
    url: '/api/system/space/modifySpace',
    method: 'post',
    data,
  });
}

// 空间详情
export function getSpaceDetails(id) {
  return service({
    url: `/api/system/space/findSpaceDetail?spaceId=${id}`,
    method: 'get',
  });
}
